export function voiceSpeak(message, rate, volumn) {
  let utterThis = new window.SpeechSynthesisUtterance()
  let lang = localStorage.getItem('lang');
  if (lang === "en") {
    lang = "en-US"
  } else {
    lang = "zh-CN";
  }
  utterThis.lang = lang;
  utterThis.rate = rate || 1;
  utterThis.volume = volumn || 1;
  utterThis.text = message;
  window.speechSynthesis.speak(utterThis)
}

export function voiceStop() {
  window.speechSynthesis.cancel()
}
